package com.ziqikeji.xianyan.controller;

import com.ziqikeji.xianyan.entity.recommend.ArticleRecommend;
import com.ziqikeji.xianyan.service.recommend.ArticleRecommendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author cyy
 * @date 2019/9/10
 *
 */
@Controller
@RequestMapping("xianyan")
public class ProtalController {

    @Autowired
    private ArticleRecommendService articleRecommendService;
    /**
     * 闲言首页
     *
     * */
    @RequestMapping(value = "/index")
    public String index(){
        return "portal/xianyan/index";
    }

    /**
     * 发现页面根据artileList修改轮播图片地址
     *//*
    @RequestMapping(value = "/find")
    public String find(Model model){
        List<ArticleRecommend> articleRecommends = new ArrayList<>();
        articleRecommends = this.articleRecommendService.getAll();
        model.addAttribute("articleList",articleRecommends);
        return "portal/xianyan/find";
    }*/

    /**
     * 发现页面
     */
    @RequestMapping(value = "/find")
    public String find(){
        return "portal/xianyan/find";
    }

    /**
     * 随笔页面
     */
    @RequestMapping(value = "/InformalEssay")
    public String InformalEssay(){
        return "portal/xianyan/InformalEssay";
    }

    /**
     * 详情页
     */
    @RequestMapping(value = "/detail")
    public String detail(){
        return "portal/xianyan/detail";
    }
}